package sng.modules.controller
{
	import org.puremvc.as3.interfaces.INotification;
	import org.puremvc.as3.patterns.command.SimpleCommand;
	
	import sng.modules.model.SocialProxy;
	import sng.modules.system.NameSpace;
	import sng.modules.system.SocialSystem;
	import sng.modules.view.SocialMediator;
	
	public class SocialCommand extends SimpleCommand
	{
		public function SocialCommand()
		{
		}
		
		override public function execute(notification:INotification):void
		{
			
			switch (notification.getName())
			{
				case SocialSystem.SocialStart://游戏登录后，社交模块初始化					
					facade.registerProxy(new SocialProxy());
					var app:Main=notification.getBody() as Main;
					facade.registerMediator(new SocialMediator(app));
					
					var socialProxy:SocialProxy = facade.retrieveProxy(SocialSystem.SocialProxyName) as SocialProxy;
					socialProxy.getFriendsListData();	
					break;
				
				default:
				break;	
			}
		}
	}
}